<h3>文章类别</h3>
<%

@options=@article_categories.collect{|p| [p.name,p.id]}
%>
<table>
  <tr>
    <th>类别名</th>
    <th>父类</th>
    <th>类别排序</th>
  </tr>

  <% for article_category in @article_categories %>
    <tr>
      <td><%=h article_category.name %></td>
      <td>
        <%= select "article_category",:parent_id,@options ,{ :include_blank => "顶级类",:selected => article_category.parent_id },:disabled=>true %>
          
      </td>

      <td><%=h article_category.cate_order %></td>
      <td><%= link_to 'Edit', edit_article_category_path(article_category) %></td>
      <td><%= link_to 'Destroy', article_category, :confirm => 'Are you sure?', :method => :delete %></td>
    </tr>
  <% end %>
</table>

<br />

<%= link_to '添加新类别', new_article_category_path %>

<fieldset class="demo">
  <LEGEND>操作说明：</LEGEND>
  <p>
    管理文章类别,请不要随意删除类别！
  </p>
</fieldset>